<template>
    <div class="auth">
      <div class="return"><span></span></div>
      <div class="log">
        <img src="../assets/QQ图片20190527144029.png"/>
      </div>
      <div class="switcher">
        <div class='cut'>
          <router-link :to="item.site" tab="span"
                       :class="['select', {active :cut === key}]"
                       @click.native="fn(key)" v-for="(item, key) in list"
                       :key =key>{{item.title}}
          </router-link>
        </div>

        <router-view></router-view>
      </div>
    </div>
</template>

<script>
  export default {
    name: 'auth',
    data(){
      return{
        cut: 0,
        list: [{title:'登录', site: '/login'},{title:'注册',site: '/register'}]
      }
    },
    methods:{
      fn(index){
        this.cut = index
      }
    }
  }
</script>

<style scoped>
  .auth{
    width: 100vw;
    height: 100vh;
  }
  .return{
    line-height: 40px;
  }
  .return span{
    margin: 20px;
    display: inline-block;
    width: 10px;
    height: 10px;
    border-left: 2px solid #555;
    border-top: 2px solid #555;
    transform: rotate(-45deg);
  }
  .log{
    height: 40px;
    text-align: center;
  }
  .log img{
    width: 40px;
    height: 40px;
  }
  .cut{
   display: flex;
    padding: 30px 100px;
  }

  .cut .select{
    margin-top: 30px;
    flex: 1;
    text-align: center;
    border-right: solid 1px #dddddd;
    text-decoration: none;
    color: #000;
  }
  .switcher .select:nth-child(2){
    border-right: none;
  }
  .active{
    color: dodgerblue;
  }
</style>
